﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Mail;
using System.Data;
using System.Data.SqlClient;
using MySql.Data.MySqlClient;

namespace EmailMarketingCampaign
{
    public partial class sendEmail : System.Web.UI.Page
    {
        DataSource ds = new DataSource();
        EmailDAO emailDAO=new EmailDAO();
        EmailDTO emailDTO = new EmailDTO();
        public int RowsOfTable = 2;

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                GridView1.DataSource = emailDAO.RetriveAllEmailUnsend();
                GridView1.DataBind();
                
            }
        }     

        protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            GridView1.PageIndex = e.NewPageIndex;
            GridView1.DataSource = emailDAO.RetriveAllEmailUnsend();
            GridView1.DataBind();
        }
    }
}
